import java.util.Scanner;
public class HelloWorld {
    public static void main(String[] args) {
        Scanner sca = new Scanner(System.in);
        System.out.println("请输入第一个整数：");
        int a = sca.nextInt();
        System.out.println("请输入第二个整数：");
        int b = sca.nextInt();
        int min = a<b?a:b;
        int max = a>b?a:b;
        for (int i = min; i >= 1; i--) {
            if(a%i == 0 && b%i == 0) {
                System.out.println("两个数的最大公约数：" +i);
                break;
            }
        }
        for (int i = max; i <= a*b; i++) {
            if(i%a == 0 && i%b == 0) {
                System.out.println("两个数的最小公倍数：" +i);
                break;
            }
        }
    }
}
